<template>
  <div id="app">
    <router-view :select="select" />
    <template v-if="routeName == 'Home'">
      <fold @close="fActive = false" class="fold-con" :select="select" :isActive="fActive"
        :class="{ 'fold-active': fActive }" />
      <vSelect v-show="$route.name=='Home'" :select="select" class="select" @select="
        (data) => {
          select = data;
        }
      " />
      <div class="btn-show" @click.stop="fActive = !fActive">参展企业</div>
    </template>

  </div>
</template>
<script>
import "@/assets/style/reset.css";
import "@/assets/style/public.css";

import fold from "@/components/fold.vue";
import select from "@/components/select.vue";

export default {
  components: {
    vSelect: select,
    fold,
  },
  data() {
    return {
      fActive: false,
      showselect: false,
      select: 2
    };
  },
  computed: {
    routeName() {
      return this.$route.name
    }
  }
};
</script>

<style lang="less">
html,
body {
  width: 100%;
  height: 100%;
}

#app {
  background: #f7f7f7;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;

  .fold-con {
    position: absolute;
    right: -500px;
    bottom: 126px;
    transition: right 0.3s ease;
  }

  .fold-active {
    z-index: 99;
    right: 20px;
  }

  .btn-show {
    text-align: center;
    color: #fff;
    background: linear-gradient(180deg, #00D3F6 0%, #1B4FF6 100%);
    bottom: 30px;
    right: 20px;
    position: absolute;
    z-index: 1;
    font-size: 16px;
    cursor: pointer;
    width: 100px;
    height: 50px;
    line-height: 50px;
    border-radius: 6px;
  }
}


@media screen and (max-width: 500px) {
  #app {
    .fold-con {
      position: absolute;
      right: -100%;
      bottom: 70px;
      transition: right 0.3s ease;
    }

    .fold-active {
      z-index: 99;
      right: 0;
    }

    .select {
      top: unset;
      right: unset;
      bottom: 33px;
      left: 15px;

      li {
        width: 83px;
        height: 30px;
        font-size: 12px;
        margin-right: 10px;
        
        &.active {
          font-weight: bold;
        }
      }
    }

    .btn-show {
      bottom: 33px;
      right: 15px;
      z-index: 1;
      font-size: 12px;
      cursor: pointer;
      width: 73px;
      height: 30px;
      line-height: 30px;
      border-radius: 6px;
    }

    &::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 77px;
      background: url('./assets/images/Rectangle-min.png') no-repeat center / cover;
    }
  }
}
</style>
